package main

import (
	"context"
	"example_shop/kitex_gen/example/shop/base"
	stock "example_shop/kitex_gen/example/shop/stock"
	"math/rand"
)

// StockServiceImpl implements the last service interface defined in the IDL.
type StockServiceImpl struct{}

// GetItemStock implements the StockServiceImpl interface.
func (s *StockServiceImpl) GetItemStock(ctx context.Context, req *stock.GetItemStockReq) (resp *stock.GetItemStockResp, err error) {
	// TODO: Your code here...
	resp = stock.NewGetItemStockResp()
	resp.Stock = int64(rand.Intn(1024))
	resp.BaseResp = base.NewBaseResp()
	resp.BaseResp.Code = "200"
	resp.BaseResp.Msg = "success"
	return
}
